package com.ve.clexer;

public class Word {
    private String data;
    private WordType type;
    private int position, row;


    public Word(int position, int row, String data, WordType type) {
        this.position = position;
        this.row = row;
        this.data = data;
        this.type = type;
    }

    public void setData(String data) {
        this.data = data;
    }

    public String getData() {
        return data;
    }

    public int getRow() {
        return row;
    }

    public int getPosition() {
        return position;
    }

    public WordType getType() {
        return type;
    }

    public boolean is(WordType t) {
        return t == type;
    }


    @Override
    public String toString() {
        return String.format("[%3d][%3d] %10s |  %s",position,row,type,data);
    }

    public int length() {
        return data.length();
    }


}
